<?php

if (!defined('IN_ADMIN')) {
    exit('Access Denied');
}

$mpurl = 'admin.php?ac=chat';
$list = array();

// 列表
$start = intval($_GET ['start']);
// 参数过滤解析
$perpage = intval($_GET ['perpage']) > 0 ? intval($_GET ['perpage']) : 20;

// 搜索条件
$intkeys = array(
    'uid',
    'id'
);
$strkeys = array(
    'nickname',
    'title'
);
$results = getparam($intkeys, $strkeys);
$mpurl .= '&' . implode('&', $results ['urls']);

// 构建api请求url与参数数组
$param = array(
    'do' => 'getChatList',
    'format' => 'json',
    'start' => $start,
    'length' => $perpage
);
$param = array_merge($param, $results ['param']);
// 读取api数据
$content = get_api_content($_SC['apiurl'], $param);
$content = json_decode($content);
$list = object_to_array($content->resultData);

// page
$pageurl = multi($start, $perpage, $mpurl);
$nextpurl = $pageurl['next'];
$prevpurl = $pageurl['prev'];
$mpurl = $pageurl['urls'];
$firstpurl = $pageurl['first'];

$perpages = array(
    $perpage => ' selected'
);

